package com.itheima.aop;

import org.aspectj.lang.ProceedingJoinPoint;

//切面类(提供了一些通知方法)
public class LogAop {

    public void before(){
        System.out.println("前置通知");//开启事务
    }
    public void afterRunning(){
        System.out.println("后置通知");//提交事务
    }
    public void afterThrow(){
        System.out.println("异常通知");//回滚事务
    }
    public void after(){
        System.out.println("最终通知");//释放资源
    }
    public void around(ProceedingJoinPoint point) throws Throwable {
        System.out.println("环绕通知");
        System.out.println(point.getSignature().getName());
        //继续执行目标方法
        point.proceed();
    }
}
